﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using l1cs.server.model.skill;

namespace l1cs.server.model.poison
{
    public class L1SilencePoison : L1Poison
    {
        private L1Character _target;

        public static bool doInfection( L1Character cha )
        {
            if ( !L1Poison.isValidTarget( cha ) )
            {
                return false;
            }

            cha.setPoison( new L1SilencePoison( cha ) );
            return true;
        }

        private L1SilencePoison( L1Character cha )
        {
            _target = cha;

            doInfection();
        }

        private void doInfection()
        {
            _target.setPoisonEffect( 1 );
            sendMessageIfPlayer( _target, 310 );

            _target.setSkillEffect( L1SkillId.STATUS_POISON_SILENCE, 0 );
        }


        override public int getEffectId()
        {
            return 1;
        }

        override public void cure()
        {
            _target.setPoisonEffect( 0 );
            sendMessageIfPlayer( _target, 311 );

            _target.killSkillEffectTimer( L1SkillId.STATUS_POISON_SILENCE );
            _target.setPoison( null );
        }
    }
}
